package ee.falcon.gui.frame.actionlisteners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import ee.falcon.gui.frame.NewOrEditProfileFrame;
import ee.falcon.gui.frame.ProfilesFrame;

public class CloseButtonListener implements ActionListener
{
	private NewOrEditProfileFrame newOrEditProfileFrame; 
	private ProfilesFrame profile; 

	public CloseButtonListener(NewOrEditProfileFrame newOrEditProfileFrame, ProfilesFrame profile)
	{
		this.newOrEditProfileFrame = newOrEditProfileFrame; 
		this.profile = profile; 
	}
	
	@Override
	public void actionPerformed(ActionEvent closeButtonEvent) 
	{
		profile.setEnabled(true); 
		newOrEditProfileFrame.setVisible(false); 
		newOrEditProfileFrame.dispose(); 
	}
	
}
